import cv2 

video_path = "/home/unionsys/Pictures/1.mp4"  
cap = cv2.VideoCapture(video_path) 
frame_count = 0  
while cap.isOpened():  
    ret, frame = cap.read()
    if not ret:  
        break  
    image_path = "/home/unionsys/Pictures/1/"+str(frame_count)+".png"  
    cv2.imwrite(image_path, frame)  
    frame_count += 1  
cap.release()

